<?php

require_once(sfConfig::get('sf_lib_dir').'/filter/base/BaseFormFilterPropel.class.php');

/**
 * Account filter form base class.
 *
 * @package    wifilez
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormFilterGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseAccountFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'created'              => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'modified'             => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'email'                => new sfWidgetFormFilterInput(),
      'password'             => new sfWidgetFormFilterInput(),
      'cookie'               => new sfWidgetFormFilterInput(),
      'role'                 => new sfWidgetFormFilterInput(),
      'disabled'             => new sfWidgetFormFilterInput(),
      'first_name'           => new sfWidgetFormFilterInput(),
      'last_name'            => new sfWidgetFormFilterInput(),
      'middle_name'          => new sfWidgetFormFilterInput(),
      'company_name'         => new sfWidgetFormFilterInput(),
      'address'              => new sfWidgetFormFilterInput(),
      'city'                 => new sfWidgetFormFilterInput(),
      'state'                => new sfWidgetFormFilterInput(),
      'zip'                  => new sfWidgetFormFilterInput(),
      'country'              => new sfWidgetFormFilterInput(),
      'phone'                => new sfWidgetFormFilterInput(),
      'mailing_list'         => new sfWidgetFormFilterInput(),
      'update_list'          => new sfWidgetFormFilterInput(),
      'subscription_id'      => new sfWidgetFormFilterInput(),
      'subscriptionplan_id'  => new sfWidgetFormFilterInput(),
      'subscription_card_id' => new sfWidgetFormFilterInput(),
      'customer_reference'   => new sfWidgetFormFilterInput(),
      'device_id'            => new sfWidgetFormFilterInput(),
      'flash_id'             => new sfWidgetFormFilterInput(),
      'good_sync_time'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'last_sync_time'       => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'last_sync_res'        => new sfWidgetFormFilterInput(),
      'last_login'           => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
      'fb_uid'               => new sfWidgetFormFilterInput(),
      'email_hash'           => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'created'              => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'modified'             => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'email'                => new sfValidatorPass(array('required' => false)),
      'password'             => new sfValidatorPass(array('required' => false)),
      'cookie'               => new sfValidatorPass(array('required' => false)),
      'role'                 => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'disabled'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'first_name'           => new sfValidatorPass(array('required' => false)),
      'last_name'            => new sfValidatorPass(array('required' => false)),
      'middle_name'          => new sfValidatorPass(array('required' => false)),
      'company_name'         => new sfValidatorPass(array('required' => false)),
      'address'              => new sfValidatorPass(array('required' => false)),
      'city'                 => new sfValidatorPass(array('required' => false)),
      'state'                => new sfValidatorPass(array('required' => false)),
      'zip'                  => new sfValidatorPass(array('required' => false)),
      'country'              => new sfValidatorPass(array('required' => false)),
      'phone'                => new sfValidatorPass(array('required' => false)),
      'mailing_list'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'update_list'          => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'subscription_id'      => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'subscriptionplan_id'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'subscription_card_id' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'customer_reference'   => new sfValidatorPass(array('required' => false)),
      'device_id'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'flash_id'             => new sfValidatorPass(array('required' => false)),
      'good_sync_time'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'last_sync_time'       => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'last_sync_res'        => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'last_login'           => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDate(array('required' => false)), 'to_date' => new sfValidatorDate(array('required' => false)))),
      'fb_uid'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'email_hash'           => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('account_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Account';
  }

  public function getFields()
  {
    return array(
      'account_id'           => 'Number',
      'created'              => 'Date',
      'modified'             => 'Date',
      'email'                => 'Text',
      'password'             => 'Text',
      'cookie'               => 'Text',
      'role'                 => 'Number',
      'disabled'             => 'Number',
      'first_name'           => 'Text',
      'last_name'            => 'Text',
      'middle_name'          => 'Text',
      'company_name'         => 'Text',
      'address'              => 'Text',
      'city'                 => 'Text',
      'state'                => 'Text',
      'zip'                  => 'Text',
      'country'              => 'Text',
      'phone'                => 'Text',
      'mailing_list'         => 'Number',
      'update_list'          => 'Number',
      'subscription_id'      => 'Number',
      'subscriptionplan_id'  => 'Number',
      'subscription_card_id' => 'Number',
      'customer_reference'   => 'Text',
      'device_id'            => 'Number',
      'flash_id'             => 'Text',
      'good_sync_time'       => 'Date',
      'last_sync_time'       => 'Date',
      'last_sync_res'        => 'Number',
      'last_login'           => 'Date',
      'fb_uid'               => 'Number',
      'email_hash'           => 'Text',
    );
  }
}
